package io.r2mo.test.common.controller.gen.orderitem;

import io.r2mo.test.common.domain.OrderItemEntity;
import io.r2mo.spring.common.webflow.PreRequest;
import io.r2mo.typed.webflow.WebRequest;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;



import io.r2mo.typed.json.JObject;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.UUID;
/**
 * <p>
 * OrderItem 请求
 * </p>
 *
 * @author lang
 * @since 2025-09-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(name = "订单项请求")
public class OrderItemCommonRequest extends PreRequest implements WebRequest<OrderItemEntity> {
    @Schema(description = "主键")
    private UUID id;
    @Schema(description = "编码")
    private String code;
    @Schema(description = "是否启用")
    private boolean enabled;
    private String orderSn;
    private String productId;
    private String productName;
    private String productNo;
    private String productScale;
    private int quantityDish;
    private BigDecimal amountDish;
    private int quantity;
    private BigDecimal amountUnit;
    private BigDecimal amountTotal;
    private BigDecimal amountDiscount;
    private UUID orderId;

    @Override
    public OrderItemEntity data() {
        final OrderItemEntity entity = new OrderItemEntity();

        this.writeScope(entity);

        this.writeTo(entity);

        return entity;
    }
}
